package com.lianbang.pharmacy.module.main

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import cn.ubest.mvvmcore.base.BaseListFragment
import com.chad.library.adapter.base.BaseQuickAdapter
import com.lianbang.pharmacy.R
import com.lianbang.pharmacy.adapter.HomeItemListAdapter
import com.lianbang.pharmacy.databinding.FragmentHomePagerBinding
import com.lianbang.pharmacy.vm.HomeVM

/**
 * Created by maoqi on 2020/11/21.
 */
class HomePagerFragment :
    BaseListFragment<HomeVM, FragmentHomePagerBinding, String>() {

    companion object {
        fun newInstance(): HomePagerFragment {
            val fragment = HomePagerFragment()
            return fragment
        }
    }

    override fun initLayout(): Int {
        return R.layout.fragment_home_pager
    }

    override fun getLayoutManager(): RecyclerView.LayoutManager {
        return GridLayoutManager(activity, 3)
    }

    override fun initData(arguments: Bundle?) {
        super.initData(arguments)
    }

    override fun initView(view: View) {
        super.initView(view)
    }

    override fun loadData() {
        mViewModel.refreshData()
    }

    override fun initAdapter(): BaseQuickAdapter<String, *> {
        return HomeItemListAdapter()
    }

}